package com.itheima.operator;

public class OperatorDemo {
    // 目标： 搞清楚基本的算数运算符
    public static void main(String[] args) {
//        printResult(10, 5);

        System.out.println("--------------------------");

        // +运算符，能算则算，不能算则做拼接
        System.out.println(10 + 5);
        System.out.println("hello" + "world");
        System.out.println("hello" + 5);
        System.out.println(5 + "hello");
        System.out.println(5 + 'a');
        System.out.println('a' + 5 + "hello");
    }

    // 设计一个方法，传入两个整数，打印两个整数用算术运算符的结果
    public static void printResult(int a, int b) {
        System.out.println(a + b);
        System.out.println(a - b);
        System.out.println(a * b);
        System.out.println(a / b);
        System.out.println(a % b);
        System.out.println(a > b);
        System.out.println(a < b);
        System.out.println(a >= b);
        System.out.println(a <= b);
        System.out.println(a == b);
        System.out.println(a != b);
        System.out.println(!(a > b));
        System.out.println(a & b);
        System.out.println(a | b);
        System.out.println(a ^ b);
        System.out.println(a << b);
        System.out.println(a >> b);
        System.out.println(a >>> b);
    }
}
